The formation of coherently strained three-dimensional islands on top of the wetting layer in Stranski-Krastanov mode of growth is considered in a model in 1+1 dimensions accounting for the anharmonicity and non-convexity of the real interatomic forces. It is shown that coherent 3D islands can be expected to form in compressed rather than in expanded overlayers beyond a critical lattice misfit. In the latter case the classical Stranski-Krastanov growth is expected to occur because the misfit dislocations can become energetically favored at smaller island sizes. The thermodynamic reason for coherent 3D islanding is the incomplete wetting owing to the weaker adhesion of the edge atoms. Monolayer height islands with a critical size appear as necessary precursors of the 3D islands. The latter explains the experimentally observed narrow size distribution of the 3D islands. The 2D-3D transformation takes place by consecutive rearrangements of mono- to bilayer, bi- to trilayer islands, etc., after exceeding the corresponding critical sizes. The rearrangements are initiated by nucleation events each next one requiring to overcome a lower energetic barrier. The model is in good qualitative agreement with available experimental observations.